<!DOCTYPE html>
<!--压制HTML中文件的警告或者错误（只有当前文件中设置生效）-->
<!-- suppress ThymeleafVariablesResolveInspection -->
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
                xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<!-- 加载头部css -->
<div th:replace="common/head::head"></div>
<!-- 加载必要的js -->
<div th:replace="common/script::script"></div>
<body>
<div class="row lyear-wrapper">
    <div class="lyear-login">
        <div class="login-center">
            <div class="login-header text-center">
                <a href="index.html"> <img alt="light year admin" src="asserts/images/logo-sidebar.png" th:src="@{/asserts/images/logo-sidebar.png}"> </a>
            </div>
            <form action="#!" th:action="@{/userlogin}" method="post">
                <div class="form-group has-feedback feedback-left">
                    <input type="text" placeholder="请输入您的用户名" class="form-control" name="username" id="username"
                           onkeypress="if(event.keyCode===13) {loginBtn.click();return false;}"/>
                    <span class="mdi mdi-account form-control-feedback" aria-hidden="true"></span>
                </div>
                <div class="form-group has-feedback feedback-left">
                    <input type="password" placeholder="请输入密码" class="form-control" id="password" name="password"
                           onkeypress="if(event.keyCode===13) {loginBtn.click();return false;}"/>
                    <span class="mdi mdi-lock form-control-feedback" aria-hidden="true"></span>
                </div>
                <!--获取拦截路径-->
                <input type="hidden" value="${requestPath}" id="requestPath">
                <div class="form-group has-feedback feedback-left row show-grid">
                    <div class="col-xs-4">
                        <label class="lyear-checkbox checkbox-primary ">
                            <input type="checkbox" id="rememberPsw" name="rememberPsw"><span>自动登陆</span>
                        </label>
                    </div>
                    <div class="col-xs-5 col-md-offset-3 ">
                        <div class="row show-grid">
                            <div class="col-xs-10 col-md-offset-2">
                                <span class="helper-text "><i class="mdi mdi-lock"></i> <a href="/lossPassword" th:href="@{/lossPassword}">忘记密码？</a></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <button class="btn btn-block btn-primary" type="button" id="loginBtn">立即登录</button>
                </div>
            </form>
            <hr>
            <footer class="col-sm-12 text-center">
                <p class="m-b-0">Copyright © 2019 <a href="http://zsjta.xicp.io/">Zhanbo</a>. All right reserved</p>
            </footer>
        </div>
    </div>
    <!--已经认证成功-->
    <div sec:authorize = "isAuthenticated()">
        <script>
            $(function () {
                window.location.href='/app/main'
            })
        </script>
    </div>
</div>
</body>
<script type="text/javascript" src="js/user/login.js" th:src="@{/js/user/login.js}"></script>
</html>